/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #e8f4f8 0%, #d6eaf8 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.5;
}

/* 头部样式 */
.header {
    position: absolute;
    top: 2rem;
    right: 2rem;
    z-index: 10;
}

.logo {
    background: rgba(60, 70, 80, 0.9);
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    font-weight: 600;
    font-size: 1rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* 容器样式 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 3rem 2rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
}

/* 拖放区域样式 */
.drop-zone,
.drop-zone.compact {
    width: 100%;
    max-width: 500px;
    margin-bottom: 1.5rem;
    background: white;
    border: 3px dashed #bdc3c7;
    border-radius: 15px;
    padding: 1rem 1rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    min-height: 160px; /* 或根据实际需要调整 */
}

/* 当有文件列表时，拖放区域使用更紧凑的样式 */
.drop-zone.compact {
    /* 保持与drop-zone一致的宽度和边距 */
    max-width: 500px;
    margin-bottom: 1.5rem;
}

.drop-zone.compact .drop-icon {
    font-size: 2.5rem;
    margin-bottom: 0.8rem;
}

.drop-zone.compact .drop-content h2 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.drop-zone.compact .drop-subtitle {
    font-size: 0.8rem;
    margin-bottom: 1rem;
}

.drop-zone.compact .select-btn {
    padding: 0.6rem 1.2rem;
    font-size: 0.85rem;
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: #3498db;
    background: #f8fcff;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.15);
}

.drop-content {
    pointer-events: none;
}

.drop-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.7;
}

.drop-content h2 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.6rem;
}

.drop-subtitle {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.select-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    pointer-events: auto;
}

.select-btn:hover {
    background: #2980b9;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

/* 文件列表样式 */
.files-section {
    width: 100%;
    max-width: 1800px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 0;
    padding: 1.5rem;
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
    margin-bottom: 2rem;
    margin-top: 1rem;
}

.files-list {
    margin-bottom: 1.5rem;
}

.file-item {
    display: grid;
    grid-template-columns: 2fr 1fr 2fr 1fr 1fr 80px;
    gap: 1rem;
    align-items: center;
    padding: 0.5rem;
    background: #f8f9fa;
    border-bottom: 1px solid #ecf0f1;
    transition: background 0.2s ease;
}

.file-item:hover {
    background: #e9ecef;
}

.file-item:last-child {
    border-bottom: none;
}

.file-name {
    font-weight: 500;
    font-size: 0.9rem;
    color: #2c3e50;
    word-break: break-word;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-original-size {
    font-size: 0.9rem;
    color: #7f8c8d;
    text-align: center;
}

.file-progress {
    height: 28px;
    background: #ecf0f1;
    border-radius: 14px;
    overflow: hidden;
    position: relative;
    border: 3px solid #dee2e6;
}

.progress-bar {
    height: 100%;
    background: #27ae60;
    border-radius: 6px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.file-compressed-size {
    font-size: 0.9rem;
    color: #27ae60;
    font-weight: 500;
    text-align: center;
}

.file-reduction {
    font-weight: 600;
    color: #27ae60;
    text-align: center;
    font-size: 0.85rem;
}

.file-actions {
    display: flex;
    justify-content: center;
}

.download-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 12px;
    font-size: 0.8rem;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.download-btn:hover {
    background: #2980b9;
    transform: translateY(-1px);
}

/* 操作按钮样式 */
.action-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-download {
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 0.2rem;
    padding: 0.6rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.btn-download:hover {
    background: #229954;
}

/* 统计卡片样式 */
.stats-card {
    width: 100%;
    max-width: 500px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0;
    padding: 1.5rem;
    margin-top: 1rem;
}

.stats-content {
    display: flex;
    align-items: center;
    justify-content: center;
}

.stats-text {
    font-size: 1.1rem;
    font-weight: 500;
    color: #2c3e50;
}

.stats-percentage {
    font-size: 1.3rem;
    color: #27ae60;
    font-weight: 700;
}

/* 提示消息样式 */
.toast {
    position: fixed;
    top: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: #27ae60;
    color: white;
    padding: 1rem 2rem;
    border-radius: 25px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    transition: transform 0.3s ease;
    z-index: 1000;
    font-weight: 500;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

.toast.error {
    background: #e74c3c;
}

.toast.warning {
    background: #f39c12;
}

.toast.success {
    background: #27ae60;
}

/* 加载遮罩样式 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #ecf0f1;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

.loading-text {
    color: #2c3e50;
    font-size: 1.1rem;
    font-weight: 500;
}

/* 动画效果 */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header {
        position: static;
        text-align: center;
        margin-bottom: 1.5rem;
    }
    
    .container {
        padding: 1.5rem 1rem;
    }
    
    .drop-zone {
        padding: 1.5rem 1rem;
        margin-bottom: 1.5rem;
        max-width: 100%;
    }
    
    .drop-content h2 {
        font-size: 1.1rem;
    }
    
    .drop-icon {
        font-size: 2.5rem;
    }
    
    .files-section {
        padding: 1rem;
        max-width: 100%;
    }
    
    .file-item {
        grid-template-columns: 1fr;
        gap: 0.5rem;
        text-align: center;
        background: #f8f9fa;
        border-radius: 8px;
        margin-bottom: 1rem;
        border: 1px solid #dee2e6;
    }
    
    .file-name {
        white-space: normal;
        text-align: left;
        font-size: 0.9rem;
        grid-column: 1;
        order: 1;
    }
    
    .file-original-size {
        order: 2;
        font-size: 0.8rem;
    }
    
    .file-original-size::before {
        content: "原始大小: ";
        font-weight: 600;
    }
    
    .file-progress {
        margin: 0.5rem 0;
        order: 3;
    }
    
    .file-compressed-size {
        order: 4;
        font-size: 0.8rem;
    }
    
    .file-compressed-size::before {
        content: "压缩后: ";
        font-weight: 600;
    }
    
    .file-reduction {
        order: 5;
        font-size: 0.9rem;
    }
    
    .file-actions {
        order: 6;
    }
    
    .action-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }
    
    .stats-card {
        max-width: 100%;
    }
    
    .stats-content {
        text-align: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 1rem 0.5rem;
    }
    
    .drop-zone {
        padding: 1.2rem 0.8rem;
    }
    
    .drop-content h2 {
        font-size: 1rem;
    }
    
    .files-section {
        padding: 0.8rem;
    }
    
    .file-item {
        padding: 0.6rem;
    }
    
    .stats-text {
        font-size: 1rem;
    }
    
    .stats-percentage {
        font-size: 1.2rem;
    }
} 